home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / MC146818.{15 < prev    next >
Text File  |  1999-09-17  |  1KB  |  47 lines

  1. /* $Id: mc146818rtc.h,v 1.3 1998/06/25 20:19:26 ralf Exp $
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Machine dependent access functions for RTC registers.
  8.  *
  9.  * Copyright (C) 1996, 1997, 1998 Ralf Baechle
  10.  */
  11. #ifndef __ASM_MIPS_MC146818RTC_H
  12. #define __ASM_MIPS_MC146818RTC_H
  13.  
  14. #include <asm/io.h>
  15.  
  16. #ifndef RTC_PORT
  17. #define RTC_PORT(x)    (0x70 + (x))
  18. #endif
  19.  
  20. /*
  21.  * The yet supported machines all access the RTC index register via
  22.  * an ISA port access but the way to access the date register differs ...
  23.  */
  24. #define CMOS_READ(addr) ({ \
  25. rtc_ops->rtc_read_data(addr); \
  26. })
  27. #define CMOS_WRITE(val, addr) ({ \
  28. rtc_ops->rtc_write_data(val, addr); \
  29. })
  30. #define RTC_ALWAYS_BCD \
  31. rtc_ops->rtc_bcd_mode()
  32.  
  33. /*
  34.  * This structure defines how to access various features of
  35.  * different machine types and how to access them.
  36.  */
  37. struct rtc_ops {
  38.     /* How to access the RTC register in a DS1287.  */
  39.     unsigned char (*rtc_read_data)(unsigned long addr);
  40.     void (*rtc_write_data)(unsigned char data, unsigned long addr);
  41.     int (*rtc_bcd_mode)(void);
  42. };
  43.  
  44. extern struct rtc_ops *rtc_ops;
  45.  
  46. #endif /* __ASM_MIPS_MC146818RTC_H */
  47.